import random, sys;
d = dict();
primes = list();
for i in range(2, 1008):
	if (i not in d.keys()):
		primes.append(i);
		for j in range(i * i, 1008, i):
			d[j] = 1;
r = random;
P = primes[r.randint(0, len(primes) - 1)];
A = r.randint(0, P - 1);
B = r.randint(0, P - 1);
X = r.randint(0, P - 1);
Y = r.randint(0, P - 1);
Z = r.randint(0, P - 1);
C = r.randint(0, P - 1);
Q = r.randint(1, 20000);
print(2);
print(str(A) + " " + str(B) + " " + str(X) + " " + str(Y) + " " + str(Z) + " " + str(P) + " " + str(C) + " " + str(Q));
for i in range(Q):
	ll = r.randint(1, 1000000);
	rr = r.randint(ll, 1000000);
	print(str(ll) + " " + str(rr));

P = primes[r.randint(0, len(primes) - 1)];
A = r.randint(0, P - 1);
B = r.randint(0, P - 1);
X = r.randint(0, P - 1);
Y = r.randint(0, P - 1);
Z = r.randint(0, P - 1);
C = r.randint(0, P - 1);
Q = r.randint(1, 20000);
print(str(A) + " " + str(B) + " " + str(X) + " " + str(Y) + " " + str(Z) + " " + str(P) + " " + str(C) + " " + str(Q));
for i in range(Q):
	ll = r.randint(1, 1000000);
	rr = r.randint(ll, 1000000);
	print(str(ll) + " " + str(rr));